/**
 * Copyright &copy; 2012-2016 <a href="https://github.com/thinkgem/jeesite">JeeSite</a> All rights reserved.
 */
package com.thinkgem.jeesite.modules.base.entity.book;

import com.fasterxml.jackson.annotation.JsonBackReference;
import com.thinkgem.jeesite.modules.base.entity.catalog.BaseCatalog;
import org.hibernate.validator.constraints.Length;

import com.thinkgem.jeesite.common.persistence.DataEntity;

import javax.validation.constraints.NotNull;

/**
 * 基础信息_书籍信息生成Entity
 * @author 呆子
 * @version 2020-02-21
 */
public class BaseBook extends DataEntity<BaseBook> {
	
	private static final long serialVersionUID = 1L;
	private BaseCatalog bookCatalogP;		// 图书大类
	private BaseCatalog bookCatalog;		// 图书小类
	private String bookCode;		// 图书编号
	private String bookName;		// 图书名称
	private Integer bookPrice;		// 单价
	private Integer bookNum;		// 总计
	private String bookInfo;		// 信息
	
	public BaseBook() {
		super();
	}

	public BaseBook(String id){
		super(id);
	}

    public BaseCatalog getBookCatalogP() {
        return bookCatalogP;
    }

    public void setBookCatalogP(BaseCatalog bookCatalogP) {
        this.bookCatalogP = bookCatalogP;
    }

    @JsonBackReference
    @NotNull(message="上级目录不能为空")
    public BaseCatalog getBookCatalog() {
        return bookCatalog;
    }

    public void setBookCatalog(BaseCatalog bookCatalog) {
        this.bookCatalog = bookCatalog;
    }

    @Length(min=1, max=20, message="图书编号长度必须介于 1 和 20 之间")
	public String getBookCode() {
		return bookCode;
	}

	public void setBookCode(String bookCode) {
		this.bookCode = bookCode;
	}
	
	@Length(min=1, max=20, message="图书名称长度必须介于 1 和 20 之间")
	public String getBookName() {
		return bookName;
	}

	public void setBookName(String bookName) {
		this.bookName = bookName;
	}

	public Integer getBookPrice() {
		return bookPrice;
	}

	public void setBookPrice(Integer bookPrice) {
		this.bookPrice = bookPrice;
	}

	public Integer getBookNum() {
		return bookNum;
	}

	public void setBookNum(Integer bookNum) {
		this.bookNum = bookNum;
	}
	
	@Length(min=1, max=255, message="信息长度必须介于 1 和 255 之间")
	public String getBookInfo() {
		return bookInfo;
	}

	public void setBookInfo(String bookInfo) {
		this.bookInfo = bookInfo;
	}
	
}